<template>
	<view class="work-container">
		<view class="" style="padding: 5px;">
			<uni-grid :column="3" @change="changeGrid">
				<uni-grid-item v-for="item in grid" :index="item.index" :key="item.index">
					<view class="grid-item-box">
						<uni-icons type="person-filled" size="30"></uni-icons>
						<text class="text">{{item.name}}</text>
					</view>
				</uni-grid-item>
			</uni-grid>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				grid: [{
					index: 1,
					name: '我的派送任务',
					url: '/pages/myDispatch/index'
				}]
			}
		},
		methods: {
			clickBannerItem(item) {
				console.info(item)
			},
			changeSwiper(e) {
				this.current = e.detail.current
			},
			changeGrid(e) {
				const grid_item = this.grid.find(i => i.index == e.detail.index)
				uni.reLaunch({
					url: grid_item.url
				})
			}
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #fff;
		min-height: 100%;
		height: auto;
	}

	view {
		font-size: 14px;
		line-height: inherit;
	}

	/* #endif */

	.text {
		text-align: center;
		font-size: 26rpx;
		margin-top: 10rpx;
	}

	.grid-item-box {
		flex: 1;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}
</style>